﻿// ## 2020/09/28 # 氕氘氚 # 重构 ##

namespace TERRAIN_FIRE_DAMAGE
{
	// 这个燃烧伤害其实是穿过火焰地形造成的伤害 
	//---------------------------------------------------------------------------
   
	const bool 着火减气 = true;

	//---------------------------------------------------------------------------

	class Main
	{
		Main()
		{
			pk::set_func(216, pk::func216_t(callback));
		}

		int callback(pk::unit@ unit, const pk::point& in pos)
		{
			int n = int(ch::randint(2, 4) / 100.f * unit.troops + pk::rand(300));
			n = batt::fire_def_skill_impact(n, unit);
			if (ch::has_skill(unit, 特技_踏破))
				n = n * pk::core::skill_constant_value(特技_踏破) / 100;
			if (着火减气)
				pk::add_energy(unit, -n / 100);
			
			//pk::trace(pk::format("216 TERRAIN_FIRE_DAMAGE {}", n));
			
			return n;
		}
	}

	Main main;
}